<?php foreach($post as $post_rec): ?>
	<div>
		<h3>Are you sure want to delete this post ?</h3>
		<div>
			<b>Post Details :</b>
			<table class="table table-bordered">
				<tr>
					<td width="15%">Post Title</td>
					<td><?php echo $post_rec['jonu_post_title'] ?></td>
				</tr>
				<tr>
					<td>Post Summary</td>
					<td>
						<?php if(strlen($post_rec['jonu_post_content']) > 150): ?>
							<?php echo substr($post_rec['jonu_post_content'], 0, 150)." . . . " ?>
						<?php else: ?>
							<?php echo $post_rec['jonu_post_content'] ?>
						<?php endif; ?>
					</td>
				</tr>
				<tr>
					<td>Post Author</td>
					<td><?php echo $post_rec['jonu_user_fullname'] ?></td>
				</tr>
				<tr>
					<td>Post Date</td>
					<td><?php echo $post_rec['jonu_post_date'] ?></td>
				</tr>			
				<tr>
					<td>Post Categories</td>
					<?php
					$this->db->join('jonu_post', 'jonu_pc.jonu_post_id = jonu_post.jonu_post_id');
					$this->db->join('jonu_category', 'jonu_pc.jonu_category_id = jonu_category.jonu_category_id');
					$this->db->where('jonu_pc.jonu_post_id', $post_rec['jonu_post_id']);
					$query = $this->db->get('jonu_pc');
					$result = $query->result_array();
					?>
					<td>
						<?php foreach($result as $cat_rec): ?>
							<?php echo $cat_rec['jonu_category_name']." <span class='text-danger'>(".$cat_rec['jonu_category_alias'].")</span> | " ?>
						<?php endforeach; ?>
					</td>
				</tr>
				<tr>
					<td>Post Image</td>
					<td>
						<?php if($post_rec['jonu_post_image'] != ""): ?>
							<img src="<?php echo base_url("asset/img/posts-image/$post_rec[jonu_post_image]") ?>" width="150"/>
						<?php else: ?>
						<?php endif; ?>
					</td>
				</tr>
			</table>
			<form action="<?php echo site_url("user/destroy_post/$post_rec[jonu_post_id]") ?>" method="post">
			<input class="btn btn-sm btn-jonu" type="submit" name="btn_delete_post" value="Yes. Delete it!"/>
			</form>
			&nbsp;
			<a href="<?php echo site_url('mimin_jonu/post') ?>" class="btn btn-sm btn-primary">No. Bring me back</a>			
		</div>
	</div>	
<?php endforeach; ?>